package project.dade.cn.bst.adapter.base;

import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import cn.bingoogolapple.androidcommon.adapter.BGARecyclerViewAdapter;
import cn.bingoogolapple.androidcommon.adapter.BGAViewHolderHelper;
import project.dade.cn.bst.R;
import project.dade.cn.bst.model.ShopModel;

/**
 * Created by vain zhou on 2016/3/4.
 */
public class SubmitAdapter extends BGARecyclerViewAdapter<ShopModel> {

    public SubmitAdapter(RecyclerView recyclerView) {
        super(recyclerView, R.layout.adapter_submit);
    }


    @Override
    protected void fillData(BGAViewHolderHelper helper, int position, ShopModel shoppingCartBean) {
        ImageView avatorIv =helper.getView(R.id.photo);
        Glide.with(mContext).load(shoppingCartBean.getProductImage()).placeholder(R.drawable.image_loader_small).error(R.drawable.image_loader_small).into(avatorIv);
        helper.setText(R.id.title, shoppingCartBean.getProductName());
        helper.setText(R.id.sell, "￥" + shoppingCartBean.getPrice());
        helper.setText(R.id.num,shoppingCartBean.getQuantity());
        helper.setText(R.id.num,shoppingCartBean.getQuantity());
        helper.setText(R.id.num, shoppingCartBean.getQuantity());
    }
}
